package com.itheima.Day14;

import java.lang.reflect.Method;

public class Demo_2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
//        met1();
//        met2();
        Class  clazz = Class.forName("com.itheima.Day14.Student_2");
        Method[] methods = clazz.getMethods();
        for (Method method : methods) {
            System.out.println(method);
        }
    }

    private static void met2() throws ClassNotFoundException {
        Class  clazz = Class.forName("com.itheima.Day14.Student_2   ");
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println(method);
        }
    }

    private static void met1() throws ClassNotFoundException, NoSuchMethodException {
        Class  clazz = Class.forName("com.itheima.Day14.Student_2");
        Method m = clazz.getDeclaredMethod("show");
        System.out.println(m);
    }
}
